using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

namespace PopLava.Tools
{
    class FontHelper
    {
        /// <summary>
        /// 
        /// </summary>
        public Font GetFont(string sFontFamily, string sFontSize, string sFontStyle)
        {
            Font font = null;
            float f = float.Parse(sFontSize);
            switch (sFontStyle)
            {
                case "Bold":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold);
                        break;
                    }
                case "Italic":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Italic);
                        break;
                    }
                case "Regular":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular);
                        break;
                    }
                case "Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Strikeout);
                        break;
                    }
                case "Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Underline);
                        break;
                    }
                case "Bold, Italic":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Italic);
                        break;
                    }
                case "Bold, Italic, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout);
                        break;
                    }
                case "Bold, Italic, Strikeout, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Italic | FontStyle.Strikeout | FontStyle.Underline);
                        break;
                    }
                case "Bold, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Strikeout);
                        break;
                    }
                case "Bold, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Underline);
                        break;
                    }
                case "Bold, Italic, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
                        break;
                    }
                case "Bold, Italic, Underline, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout);
                        break;
                    }
                case "Italic, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Italic | FontStyle.Strikeout);
                        break;
                    }
                case "Italic, Strikeout, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Italic | FontStyle.Strikeout | FontStyle.Underline);
                        break;
                    }
                case "Italic, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Italic | FontStyle.Underline);
                        break;
                    }
                case "Regular, Italic":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Italic);
                        break;
                    }
                case "Regular, Italic, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Italic | FontStyle.Strikeout);
                        break;
                    }
                case "Regular, Italic, Strikeout, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Italic | FontStyle.Strikeout | FontStyle.Underline);
                        break;
                    }
                case "Regular, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Strikeout);
                        break;
                    }
                case "Regular, Strikeout, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Strikeout | FontStyle.Underline);
                        break;
                    }
                case "Regular, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Underline);
                        break;
                    }
                case "Regular, Italic, Underline":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Regular | FontStyle.Italic | FontStyle.Underline);
                        break;
                    }
                case "Underline, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Underline | FontStyle.Strikeout);
                        break;
                    }
                case "Italic, Underline, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout);
                        break;
                    }
                case "Bold, Underline, Strikeout":
                    {
                        font = new Font(sFontFamily, f, FontStyle.Bold | FontStyle.Underline | FontStyle.Strikeout);
                        break;
                    }
                default:
                    {
                        MessageBox.Show(sFontStyle);
                        break;
                    }
            }
            return font;
        }
    }
}
